<?php


namespace app\api\controller\mall;


use app\api\controller\ApiBase;
use app\common\business\Goods;
use app\common\lib\Show;

class Lists extends ApiBase
{
    public function index()
    {
        $page_size = input('page_size', 10, 'intval');
        $category_id = input('category_id', 0, 'intval');

        if (!$category_id) {
            return Show::success();
        }

        $data = [
            'category_id' => $category_id,
        ];

        $goods = (new Goods())->getNormalList($data, $page_size);

        return Show::success($goods);
    }
}